﻿@using JT.Domain
@inject JT.WEB.Service.IUserCenter UserCenter;
@{ 
    int SystemMsCount = UserCenter.GetMessages(c=>c.MSLevel==EMSLevel.SystemMassage).Count(m=>!m.Read);
    int CommentMSCount =UserCenter.GetMessages(c=>c.MSLevel==EMSLevel.CommentReply).Count(m=>!m.Read);
    int WorkMSCount =UserCenter.GetMessages(c=>c.MSLevel==EMSLevel.WorkNotice).Count(m=>!m.Read);
    int AtMeMSCount =UserCenter.GetMessages(c=>c.MSLevel==EMSLevel.AtMe).Count(m=>!m.Read);
}
<style>
    #msnav a {
        background-color: rgba(255,255,255,0.8);
        color: #6b757b;
        font-weight: 900;
        border-radius: 0.5rem;
        margin-bottom: 0.5rem;
    }

        #msnav a:hover, #msnav a:active, #msnav a:focus {
            border-radius: 0.5rem;
            color: #2faee3;
        }

    #overflowTest {
        background-color: rgba(255,255,255,0.5);
        /*height:800px;*/
        overflow: auto;
        border-radius: 0.5rem;
    }
</style>
<div class="list-group" id="msnav">
    <a class="list-group-item list-group-item-action btn btn-success active" asp-controller="Message" asp-action="Index">
        <span class="fa fa-commenting text-success"></span> 系统消息
        @if (SystemMsCount > 0)
        {

            <span class="badge badge-success">@SystemMsCount</span>
        }

    </a>
    <a class="list-group-item list-group-item-action btn btn-success" asp-controller="Message" asp-action="CommentReply">
        <span class="fa fa-commenting-o text-success"></span> 评论回复
        @if (CommentMSCount > 0)
        {

            <span class="badge badge-success">@CommentMSCount</span>
        }
    </a>
    <a class="list-group-item list-group-item-action btn btn-success" asp-controller="Message" asp-action="WorkNotice">
        <span class="fa fa-info text-success"></span> 工作通知
        @if (WorkMSCount > 0)
        {

            <span class="badge badge-success">@WorkMSCount</span>
        }
    </a>
    <a class="list-group-item list-group-item-action btn btn-success" asp-controller="Message" asp-action="AtMe">
        <span class="fa fa-at text-success"></span>我的
        @if (AtMeMSCount > 0)
        {

            <span class="badge badge-success">@AtMeMSCount</span>
        }
    </a>
    @if (User.IsInRole("Administrators"))
    {
        <a class="list-group-item list-group-item-action btn btn-success" asp-controller="Message" asp-action="SendMessage">发送消息</a>
        <a class="list-group-item list-group-item-action btn btn-success" asp-controller="Message" asp-action="SendedMessages">已发消息</a>
        <a class="list-group-item list-group-item-action btn btn-success" asp-action="Index" asp-controller="Years">年份</a>
        <a class="list-group-item list-group-item-action btn btn-success" asp-action="Index" asp-controller="TimeLines">事件</a>
        <a class="list-group-item list-group-item-action btn btn-success" asp-action="Index" asp-controller="Abilities">检测能力</a>
    }
</div>
